/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package info.bondtnt.labs.model.research.impl;

import info.bondtnt.labs.model.research.AbstractBoundedGenericParameter;
import info.bondtnt.labs.model.research.BoundedDoubleParameter;
import info.bondtnt.labs.model.research.BoundedGenericParameter;
import info.bondtnt.labs.model.research.NamedDoubleParameter;
import info.bondtnt.labs.model.research.ParametersList;
import info.bondtnt.labs.model.research.ResearchFactory;
import info.bondtnt.labs.model.research.ResearchPackage;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EGenericType;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.ETypeParameter;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class ResearchPackageImpl extends EPackageImpl implements ResearchPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass abstractBoundedGenericParameterEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass boundedDoubleParameterEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass boundedGenericParameterEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass namedDoubleParameterEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass parametersListEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see info.bondtnt.labs.model.research.ResearchPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private ResearchPackageImpl() {
		super(eNS_URI, ResearchFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this
	 * model, and for any others upon which it depends.  Simple
	 * dependencies are satisfied by calling this method on all
	 * dependent packages before doing anything else.  This method drives
	 * initialization for interdependent packages directly, in parallel
	 * with this package, itself.
	 * <p>Of this package and its interdependencies, all packages which
	 * have not yet been registered by their URI values are first created
	 * and registered.  The packages are then initialized in two steps:
	 * meta-model objects for all of the packages are created before any
	 * are initialized, since one package's meta-model objects may refer to
	 * those of another.
	 * <p>Invocation of this method will not affect any packages that have
	 * already been initialized.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static ResearchPackage init() {
		if (isInited) return (ResearchPackage)EPackage.Registry.INSTANCE.getEPackage(ResearchPackage.eNS_URI);

		// Obtain or create and register package
		ResearchPackageImpl theResearchPackage = (ResearchPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ResearchPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ResearchPackageImpl());

		isInited = true;

		// Create package meta-data objects
		theResearchPackage.createPackageContents();

		// Initialize created meta-data
		theResearchPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theResearchPackage.freeze();

		return theResearchPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getAbstractBoundedGenericParameter() {
		return abstractBoundedGenericParameterEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getAbstractBoundedGenericParameter_Name() {
		return (EAttribute)abstractBoundedGenericParameterEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getBoundedDoubleParameter() {
		return boundedDoubleParameterEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getBoundedDoubleParameter_FirstValue() {
		return (EAttribute)boundedDoubleParameterEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getBoundedDoubleParameter_LastValue() {
		return (EAttribute)boundedDoubleParameterEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getBoundedDoubleParameter_StepValue() {
		return (EAttribute)boundedDoubleParameterEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getBoundedGenericParameter() {
		return boundedGenericParameterEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getBoundedGenericParameter_AllValues() {
		return (EAttribute)boundedGenericParameterEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getNamedDoubleParameter() {
		return namedDoubleParameterEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getNamedDoubleParameter_Name() {
		return (EAttribute)namedDoubleParameterEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getNamedDoubleParameter_Value() {
		return (EAttribute)namedDoubleParameterEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getParametersList() {
		return parametersListEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getParametersList_List() {
		return (EAttribute)parametersListEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ResearchFactory getResearchFactory() {
		return (ResearchFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		abstractBoundedGenericParameterEClass = createEClass(ABSTRACT_BOUNDED_GENERIC_PARAMETER);
		createEAttribute(abstractBoundedGenericParameterEClass, ABSTRACT_BOUNDED_GENERIC_PARAMETER__NAME);

		boundedDoubleParameterEClass = createEClass(BOUNDED_DOUBLE_PARAMETER);
		createEAttribute(boundedDoubleParameterEClass, BOUNDED_DOUBLE_PARAMETER__FIRST_VALUE);
		createEAttribute(boundedDoubleParameterEClass, BOUNDED_DOUBLE_PARAMETER__LAST_VALUE);
		createEAttribute(boundedDoubleParameterEClass, BOUNDED_DOUBLE_PARAMETER__STEP_VALUE);

		boundedGenericParameterEClass = createEClass(BOUNDED_GENERIC_PARAMETER);
		createEAttribute(boundedGenericParameterEClass, BOUNDED_GENERIC_PARAMETER__ALL_VALUES);

		namedDoubleParameterEClass = createEClass(NAMED_DOUBLE_PARAMETER);
		createEAttribute(namedDoubleParameterEClass, NAMED_DOUBLE_PARAMETER__NAME);
		createEAttribute(namedDoubleParameterEClass, NAMED_DOUBLE_PARAMETER__VALUE);

		parametersListEClass = createEClass(PARAMETERS_LIST);
		createEAttribute(parametersListEClass, PARAMETERS_LIST__LIST);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters
		ETypeParameter abstractBoundedGenericParameterEClass_Type = addETypeParameter(abstractBoundedGenericParameterEClass, "Type");
		ETypeParameter boundedGenericParameterEClass_Type = addETypeParameter(boundedGenericParameterEClass, "Type");
		ETypeParameter parametersListEClass_Type = addETypeParameter(parametersListEClass, "Type");

		// Set bounds for type parameters

		// Add supertypes to classes
		EGenericType g1 = createEGenericType(this.getAbstractBoundedGenericParameter());
		EGenericType g2 = createEGenericType(ecorePackage.getEDoubleObject());
		g1.getETypeArguments().add(g2);
		boundedDoubleParameterEClass.getEGenericSuperTypes().add(g1);
		g1 = createEGenericType(this.getAbstractBoundedGenericParameter());
		g2 = createEGenericType(boundedGenericParameterEClass_Type);
		g1.getETypeArguments().add(g2);
		boundedGenericParameterEClass.getEGenericSuperTypes().add(g1);

		// Initialize classes and features; add operations and parameters
		initEClass(abstractBoundedGenericParameterEClass, AbstractBoundedGenericParameter.class, "AbstractBoundedGenericParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getAbstractBoundedGenericParameter_Name(), ecorePackage.getEString(), "name", null, 0, 1, AbstractBoundedGenericParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		addEOperation(abstractBoundedGenericParameterEClass, ecorePackage.getEIntegerObject(), "countOfValues", 0, 1, IS_UNIQUE, IS_ORDERED);

		EOperation op = addEOperation(abstractBoundedGenericParameterEClass, null, "getValueByIndex", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEIntegerObject(), "index", 0, 1, IS_UNIQUE, IS_ORDERED);
		g1 = createEGenericType(abstractBoundedGenericParameterEClass_Type);
		initEOperation(op, g1);

		initEClass(boundedDoubleParameterEClass, BoundedDoubleParameter.class, "BoundedDoubleParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getBoundedDoubleParameter_FirstValue(), ecorePackage.getEDoubleObject(), "firstValue", null, 0, 1, BoundedDoubleParameter.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getBoundedDoubleParameter_LastValue(), ecorePackage.getEDoubleObject(), "lastValue", null, 0, 1, BoundedDoubleParameter.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getBoundedDoubleParameter_StepValue(), ecorePackage.getEDoubleObject(), "stepValue", null, 0, 1, BoundedDoubleParameter.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		addEOperation(boundedDoubleParameterEClass, ecorePackage.getEDoubleObject(), "allValues", 0, -1, IS_UNIQUE, IS_ORDERED);

		op = addEOperation(boundedDoubleParameterEClass, null, "setBoundaries", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEDouble(), "firstValue", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEDouble(), "lastValue", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEDouble(), "stepValue", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEClass(boundedGenericParameterEClass, BoundedGenericParameter.class, "BoundedGenericParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		g1 = createEGenericType(boundedGenericParameterEClass_Type);
		initEAttribute(getBoundedGenericParameter_AllValues(), g1, "allValues", null, 0, -1, BoundedGenericParameter.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		op = addEOperation(boundedGenericParameterEClass, null, "addValue", 0, 1, IS_UNIQUE, IS_ORDERED);
		g1 = createEGenericType(boundedGenericParameterEClass_Type);
		addEParameter(op, g1, "value", 0, 1, IS_UNIQUE, IS_ORDERED);

		addEOperation(boundedGenericParameterEClass, null, "removeAllValues", 0, 1, IS_UNIQUE, IS_ORDERED);

		op = addEOperation(boundedGenericParameterEClass, null, "removeValue", 0, 1, IS_UNIQUE, IS_ORDERED);
		g1 = createEGenericType(boundedGenericParameterEClass_Type);
		addEParameter(op, g1, "value", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEClass(namedDoubleParameterEClass, NamedDoubleParameter.class, "NamedDoubleParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getNamedDoubleParameter_Name(), ecorePackage.getEString(), "name", null, 0, 1, NamedDoubleParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getNamedDoubleParameter_Value(), ecorePackage.getEDoubleObject(), "value", null, 0, 1, NamedDoubleParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(parametersListEClass, ParametersList.class, "ParametersList", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		g1 = createEGenericType(parametersListEClass_Type);
		initEAttribute(getParametersList_List(), g1, "list", null, 0, -1, ParametersList.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		op = addEOperation(parametersListEClass, null, "addParameter", 0, 1, IS_UNIQUE, IS_ORDERED);
		g1 = createEGenericType(parametersListEClass_Type);
		addEParameter(op, g1, "namedParam", 0, 1, IS_UNIQUE, IS_ORDERED);

		// Create resource
		createResource(eNS_URI);
	}

} //ResearchPackageImpl
